package com.lyj.io.module.data.entity;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 字典表
 * @author liyaji
 * @email 17710557864@163.com
 * @date 2022-01-04 14:55:20
 */
@ApiModel("字典表")
@Data
@TableName("sys_dict")
public class SysDictEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * 主键
	 */
    @ApiModelProperty(value = "主键", example = "")
	@TableId(type = IdType.ASSIGN_ID)
	private String id;
	/**
	 * 字典名称
	 */
    @ApiModelProperty(value = "字典名称", example = "")
	@TableField(value = "dict_name")
	private String dictName;
	/**
	 * 字典名称
	 */
	@ApiModelProperty(value = "字典编码", example = "")
	@TableField(value = "dict_code")
	private String dictCode;
	/**
	 * 所属字典
	 */
    @ApiModelProperty(value = "所属字典", example = "")
	@TableField(value = "parent_id")
	private Long parentId;

	/**
	 * 序号
	 */
    @ApiModelProperty(value = "序号", example = "")
	@TableField(value = "sort_no")
	private Integer sortNo;
	/**
	 * 创建者
	 */
    @ApiModelProperty(value = "创建者", example = "")
	@TableField(value = "creater")
	private Long creater;
	/**
	 * 创建时间
	 */
	@ApiModelProperty(value = "创建时间", example = "")
	@TableField(value = "CREATE_DATE", fill = FieldFill.INSERT)
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
	private Date createDate;

	/**
	 * 更新时间
	 */
	@ApiModelProperty(value = "更新时间", example = "")
	@TableField(value = "UPDATE_DATE", fill = FieldFill.INSERT_UPDATE)
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
	private Date updateDate;
	/**
	 * 备注
	 */
    @ApiModelProperty(value = "备注", example = "")
	@TableField(value = "remark")
	private String remark;
	/**
	 * 删除标识
	 */
    @ApiModelProperty(value = "删除标识", example = "")
	@TableField(value = "delete_flag")
	private String deleteFlag;

	/**
	 * 是否有字典选项
	 */
	@TableField(exist = false)
	private Boolean hasChildren = true;

	/**
	 * 字典选项
	 */
	@TableField(exist = false)
	private List<SysDictEntity> children = new ArrayList<SysDictEntity>();

}
